<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:icecore="http://www.icefaces.org/icefaces/core"
	xmlns:ace="http://www.icefaces.org/icefaces/components"
	xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head>
	<title><ice:outputLabel value="#{msgs_common.PAGE_TITLE}"></ice:outputLabel></title>
	<ice:outputStyle href="#{baseMBean.securedOutPutStyleURL}"></ice:outputStyle>
</h:head>
<h:body class="#{baseMBean.securedOutPutBodyClass}">
	<f:loadBundle
		basename="com/avecsys/quotemanager/resources/messages_supplier"
		var="msgs_supplier"></f:loadBundle>
	<f:loadBundle
		basename="com/avecsys/quotemanager/resources/messages_common"
		var="msgs_common"></f:loadBundle>
	<c:if test="${baseMBean.menuBarEnabled == 'true'}">
		<h:form id="menuBarForm">
			<icecore:singleSubmit />
			<ice:menuBar styleClass="menuBar">
		        <ice:menuItems value="#{menuBarMBean.menuModel}"/>
		    </ice:menuBar>
	    </h:form>		
	</c:if>
	<h:form id="QuoteTemplateFormID">
		<f:event listener="#{loginMBean.isUserSignedIn}" type="preRenderView"></f:event>
		<div class="page-container">
			<div class="pageHeader">
				<ice:panelGrid columns="2">
					<ice:graphicImage
						url="#{quoteTemplateMasterMBean.getImageResourceURL('PAGE_HEADER_ICON_QUOTE_TEMPLATE_MASTER')}"></ice:graphicImage>
					<ice:outputLabel
						value="#{msgs_supplier.QUOTE_TEMPLATE_FORM_MODIFY_HEADER_SECTION_TITLE}"
						styleClass="pageHeaderTitleText"></ice:outputLabel>
				</ice:panelGrid>
			</div>
			<center>
				<div>
					<ice:inputHidden
						value="#{quoteTemplateMasterMBean.quoteTemplateMasterPojo.templateId}"
						id="templateID" />
					<ice:inputHidden id="quoteTemplateVersionID"
						value="#{quoteTemplateMasterMBean.quoteTemplateMasterPojo.version}" />
				</div>
				<div class="fieldsContainer">
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.QUOTE_TEMPLATE_FORM_TEMPLATE_NAME}" />
						<span class="field"> <ice:inputText id="quoteTemplateNameId"
								binding="#{quoteTemplateMasterMBean.widgetTemplateName}"
								value="#{quoteTemplateMasterMBean.quoteTemplateMasterPojo.templateName}"
								required="true" immediate="true">
								<f:validator validatorId="supplierQuoteTemplateNameUnique" />
							</ice:inputText>
						</span> <span class="fieldMessage"><ice:message
								styleClass="iceMsgError" for="quoteTemplateNameId" /></span>
					</div>
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.QUOTE_TEMPLATE_FORM_TEMPLATE_DESCRIPTION}" />
						<span class="field"> <ice:inputText id="quoteTemplateDescId"
								binding="#{quoteTemplateMasterMBean.widgetTemplateDescription}"
								value="#{quoteTemplateMasterMBean.quoteTemplateMasterPojo.templateDescription}"
								required="true" immediate="true" />
						</span> <span class="fieldMessage"><ice:message
								styleClass="iceMsgError" style="color:red;"
								for="quoteTemplateDescId" /></span>
					</div>
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.QUOTE_TEMPLATE_FORM_MODIFY_FILE_ATTACHMENT}" />
						<span class="field"> <ice:selectBooleanCheckbox
								id="needToModifyID" immediate="true" partialSubmit="true"
								value="#{quoteTemplateMasterMBean.modifyExistingQuoteAttachment}"
								valueChangeListener="#{quoteTemplateMasterMBean.actionModifyExistingQuoteAttachment}"></ice:selectBooleanCheckbox>
						</span>
					</div>
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.QUOTE_TEMPLATE_FORM_FILE_ATTACHMENT}" />
						<span class="field"> <ace:fileEntry id="fileAttachmentId"
								disabled="#{quoteTemplateMasterMBean.quoteAttachmentDisabled}"
								immediateValidation="true" maxFileCount="1" immediate="true"
								fileEntryListener="#{quoteTemplateMasterMBean.actionQuoteAttachmentListener}"
								maxFileSize="6291456"
								maxFileSizeMessage="Submitted file is too large."
								requiredMessage="The file is required to submit this form."
								useOriginalFilename="true" useSessionSubdir="true"
								required="#{quoteTemplateMasterMBean.modifyExistingQuoteAttachment}" />
						</span> <span class="fieldMessage"><ice:message
								styleClass="iceMsgError" style="color:red;"
								for="fileAttachmentId" /></span>
					</div>
					<div class="field_row">
						<ice:outputLabel
							value="#{msgs_supplier.QUOTE_TEMPLATE_FORM_FILE_ATTACHMENT_EXISTING}" />
						<span class="field"> <ice:outputResource id="imgRsource"
								resource="#{quoteTemplateMasterMBean.quoteTemplateWrapper.quoteTemplateResource}"
								label="#{quoteTemplateMasterMBean.quoteTemplateMasterPojo.fileName}"
								fileName="#{quoteTemplateMasterMBean.quoteTemplateMasterPojo.fileName}"
								mimeType="#{quoteTemplateMasterMBean.quoteTemplateMasterPojo.contentType}"
								attachment="true">
							</ice:outputResource>
						</span>
					</div>
				</div>
				<div>
					<ice:panelGrid columns="2">
						<h:commandButton
							value="#{msgs_supplier.SUPPLIER_FORM_ACTION_SUBMIT}" type="submit"
							action="#{quoteTemplateMasterMBean.actionSaveQuoteTemplate}"
							styleClass="color green button"></h:commandButton>
						<ice:commandButton
							value="#{msgs_supplier.SUPPLIER_FORM_ACTION_CANCEL}"
							immediate="true" action="#{quoteTemplateMasterMBean.actionCancel}"
							styleClass="color green button"></ice:commandButton>
					</ice:panelGrid>
				</div>
			</center>
		</div>
	</h:form>
</h:body>
</html>
